import '../addDetail.dart';
import 'package:flutter/material.dart';

class HistoryPage extends StatefulWidget {
  const HistoryPage({super.key});

  @override
  State<HistoryPage> createState() => _HistoryPageState();
}

class _HistoryPageState extends State<HistoryPage> {
  @override
  Widget build(BuildContext context) {
    String addDetailName = "阿巴阿巴";
    return Center(
      child: ListTile(
        // 输入框
        leading: Text("添加$addDetailName"),
        // 标题
        title: ElevatedButton(
            onPressed: () {
              Navigator.of(context)
                  .push(MaterialPageRoute(builder: (BuildContext context) {
                return AddDetailPage(addType: addDetailName);
              }));
            },
            child: const Icon(Icons.add)),
      ),
    );
  }
}
